import request from '@/utils/request'

// 查询生产企业信息列表
export function listEnterprise(query) {
  return request({
    url: '/business/enterprise/list',
    method: 'get',
    params: query
  })
}

// 通过审核企业信息列表
export function listEnterprisePass(query) {
  return request({
    url: '/business/enterprise/listpass',
    method: 'get',
    params: query
  })
}

// 待审核企业信息列表
export function listEnterpriseWait(query) {
  return request({
    url: '/business/enterprise/listwait',
    method: 'get',
    params: query
  })
}

// 待整改企业信息列表
export function listEnterpriseRectify(query) {
  return request({
    url: '/business/enterprise/listrectify',
    method: 'get',
    params: query
  })
}

// 已注销企业信息列表
export function listEnterpriseCancel(query) {
  return request({
    url: '/business/enterprise/listcancel',
    method: 'get',
    params: query
  })
}

// 查询生产企业信息详细
export function getEnterprise(companyId) {
  return request({
    url: '/business/enterprise/' + companyId,
    method: 'get'
  })
}

// 新增生产企业信息
export function addEnterprise(data) {
  return request({
    url: '/business/enterprise',
    method: 'post',
    data: data
  })
}

// 修改生产企业信息
export function updateEnterprise(data) {
  return request({
    url: '/business/enterprise',
    method: 'put',
    data: data
  })
}

// 删除生产企业信息
export function delEnterprise(companyId) {
  return request({
    url: '/business/enterprise/' + companyId,
    method: 'delete'
  })
}
